Release 10.1A: OpenEdge Development:
AppBuilder
Switching between layouts at run time
The multiple layout functionality that the AppBuilder provides is meant primarily to establish a layout once: when you run a procedure file. However, you can also switch among layouts at run time, if you write the necessary code to manage it.
Note: For SmartObjects, all of the code for switching among layouts at run time is managed by the ADMsetInstanceProperties()function andapplyLayout()procedure. For more information, see the "Applying SmartObject layouts at run time" section.One way to switch among layouts is to have a trigger execute the
CASEstatement entries for the different layouts.
![]()
To have a trigger execute the CASE statement entries for the different layouts:
- Execute the
“MasterLayout”CASEentry in the layout cases internal procedure with the following statement. The{&LAYOUT-VARIABLE}preprocessor name is set:
This statement changes all of the run-time properties to match those of the master layout. This step is necessary because all of the other layouts change their settings relative to the master layout. Thus, before you can switch to a new layout, you should switch back to the master layout.
- Execute the
CASEentry for the layout you want. This sets all of the layout’s properties that you specify:
- If necessary, write code that correctly enables the widgets in the new layout.
If widgets are enabled differently from one layout to another, you cannot execute the
Enable_UIprocedure to do your enabling. TheEnable_UIprocedure enables widgets based onWHENphrases built using the layouts’ associated run-time expressions. The explicit purpose of these run-time expressions is to identify a unique run-time environment. Since you want to switch layouts only within the same run-time environment, you must write your own code to handle the enabling.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |